cmake_minimum_required(VERSION 3.15)
project(IrrXML LANGUAGES CXX)

include(GNUInstallDirs)

add_library(IrrXML ${IRRXML_SRC_DIR}/src/irrXML.cpp)
set_target_properties(IrrXML PROPERTIES
    WINDOWS_EXPORT_ALL_SYMBOLS ON
    PUBLIC_HEADER ${IRRXML_SRC_DIR}/src/irrXML.h
)
if(MSVC)
    target_compile_definitions(IrrXML PRIVATE _SCL_SECURE_NO_WARNINGS _CRT_SECURE_NO_WARNINGS)
endif()

install(TARGETS IrrXML
    ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
    PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
